package hr.fer.zesoi.neumre.tetriminos;

import hr.fer.zesoi.neumre.tetriminos.common.Location;

public class ITetrimino extends Tetrimino {

	public ITetrimino() {

		this.reset();
	}

	@Override
	public void reset() {

		this.pixelRelLocs[0] = new Location(-1, 0);
		this.pixelRelLocs[1] = new Location(0, 0);
		this.pixelRelLocs[2] = new Location(1, 0);
		this.pixelRelLocs[3] = new Location(2, 0);
		
		this.currentRotation = 0;
	}

	@Override
	public void rotate() {

		switch (currentRotation) {

		case 0:
			this.pixelRelLocs[0] = new Location(0, 1);
			this.pixelRelLocs[2] = new Location(0, -1);
			this.pixelRelLocs[3] = new Location(0, -2);
			break;
		case 1:
			this.pixelRelLocs[0] = new Location(-1, 0);
			this.pixelRelLocs[2] = new Location(1, 0);
			this.pixelRelLocs[3] = new Location(2, 0);
			break;
		}

		currentRotation = (currentRotation + 1) % 2;
	}
}
